#ifndef _LOG_H
#define _LOG_H

// #include "core.h"
#include <stdio.h>

#define LOG_PREFIX_LEN 100
#define LOG_PAYLOAD_LEN 1000

void log_print(char* probe,int level,const char *format, ...);

#define log_debug(probe,format, ...) log_print(probe,0,format, ##__VA_ARGS__);
#define log_info(probe,format, ...) log_print(probe,1,format, ##__VA_ARGS__);
#define log_warn(probe,format, ...) log_print(probe,2,format, ##__VA_ARGS__);
#define log_err(probe,format, ...) \
        do{ \
            char fmt[LOG_PAYLOAD_LEN*2] = ""; \
            strcat(fmt,"%s %d -->"); \
            strcat(fmt,format); \
            log_print(probe,3,fmt, __FILE__,__LINE__,##__VA_ARGS__); \
        }while(0) \

#endif